--- /dev/null
+/*
+ Abstract fixed size data types.
+
+ Copyright (C) 2005 Robert Lipe, robertlipe@usa.net
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+
+/*
+ * If this is a problem and any interesting system doesn't have the C99-ism
+ * of <stdint.h> we'll come up with something more clever that'll likely
+ * include a gross collection of __STDC_VERSION >= 199901L || __GNUC__
+ */
+
+
+#include <stdint.h>
+
+typedef uint32_t gbuint32;
+typedef uint16_t gbuint16;
+typedef int32_t gbint32;
+typedef int16_t gbint16;
unsigned short
ReadShort(FILE * f)
{
- unsigned short result = 0;
+ gbuint16 result = 0;
fread(&result, sizeof (result), 1, f);
return le_read16(&result);
unsigned long
ReadLong(FILE * f)
{
- unsigned long result = 0;
+ gbuint32 result = 0;
fread(&result, sizeof (result), 1, f);
return le_read32(&result);
unsigned char *record;
static int serial = 0;
struct ll {
- long lat;
- long lon;
+ gbint32 lat;
+ gbint32 lon;
} *latlon;
unsigned short coordcount;
route_head *track_head;
}
}
if ( version > 10 ) {
- Skip(infile,2*sizeof(long));
+ Skip(infile,2*sizeof(gbuint32));
}
xfree(record);
}